package com.fsserver.core.mapper;

import com.fsserver.core.entity.PaymentOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 支付订单Mapper接口
 * Payment Order Mapper
 *
 * @author fsserver
 */
public interface PaymentOrderMapper extends BaseMapper<PaymentOrder> {

    /**
     * 根据订单号获取支付订单
     * Get payment order by order number
     *
     * @param orderNo 订单号
     * @return 支付订单
     */
    PaymentOrder getByOrderNo(String orderNo);

    /**
     * 根据业务订单号获取支付订单
     * Get payment order by business order number
     *
     * @param businessOrderNo 业务订单号
     * @return 支付订单
     */
    PaymentOrder getByBusinessOrderNo(String businessOrderNo);

    /**
     * 根据状态查询支付订单列表
     * List payment orders by status
     *
     * @param status 支付订单状态
     * @return 支付订单列表
     */
    List<PaymentOrder> listByStatus(String status);

    /**
     * 根据用户ID查询支付订单列表
     * List payment orders by user ID
     *
     * @param userId 用户ID
     * @return 支付订单列表
     */
    List<PaymentOrder> listByUserId(Long userId);

    /**
     * 关闭支付订单
     * Close payment order
     *
     * @param orderNo 订单号
     * @return 影响行数
     */
    int closeOrder(@Param("orderNo") String orderNo);
} 